<template>
  <div>
    
    <el-form :inline="true" :model="Show.formInline" class="demo-form-inline">
      <el-form-item label="行业">
        <el-select v-model="Show.formInline.hang" placeholder="请选择">
          <el-option label="请选择" value="0"></el-option>
          <el-option
            v-for="item in hangs"
            :key="item.com_ind_id"
            :label="item.com_ind_name"
            :value="item.com_ind_id"
          >
          </el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="Ka">
        <el-select v-model="Show.formInline.ka" placeholder="请选择">
          <el-option label="请选择" value="0"></el-option>
          <el-option
            v-for="item in kas"
            :key="item.com_ka_id"
            :label="item.com_ka_name"
            :value="item.com_ka_id"
          >
          </el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="区域">
        <el-select v-model="Show.formInline.qu" placeholder="请选择">
          <el-option label="请选择" value="0"></el-option>
          <el-option
            v-for="item in qus"
            :key="item.area_id"
            :label="item.area_name"
            :value="item.area_id"
          >
          </el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="分级">
        <el-select v-model="Show.formInline.fen" placeholder="请选择">
          <el-option label="请选择" value="0"></el-option>
          <el-option
            v-for="item in fens"
            :key="item.leve_id"
            :label="item.leve_name"
            :value="item.leve_id"
          >
          </el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="公司">
        <el-input v-model="Show.formInline.gong"></el-input>
      </el-form-item>

      <el-form-item label="客户姓名">
        <el-input v-model="Show.formInline.xname"></el-input>
      </el-form-item>

      <el-form-item label="视频KA">
        <el-select v-model="Show.formInline.shi" placeholder="视频KA">
          <el-option label="请选择" value="0"></el-option>
          <el-option label="待定" value="1"></el-option>
          <el-option label="你好" value="2"></el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="AD tech">
        <el-select v-model="Show.formInline.ad" placeholder="AD tech">
          <el-option label="请选择" value="0"></el-option>
          <el-option label="否" value="1"></el-option>
          <el-option label="待定" value="2"></el-option>
        </el-select>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="ClientShowCha">查询</el-button>
      </el-form-item>
    </el-form>
    
    <el-link @click="ClientAdd">添加</el-link> <el-link>导入</el-link>
    <el-link>导出</el-link>
    <el-table :data="Show.tableData" height="250" border style="width: 100%">
      <el-table-column prop="cust_id" label="ID" width="180"> </el-table-column>
      <el-table-column prop="area_name" label="区域" width="180">
      </el-table-column>
      <el-table-column prop="com_ind_name" label="行业"> </el-table-column>
      <el-table-column prop="com_name" label="公司名称"> </el-table-column>
      <el-table-column prop="cust_name" label="姓名"> </el-table-column>
      <el-table-column label="性别">
        <template slot-scope="scope">
          <el-label v-if="scope.row.cust_sex">男</el-label>
          <el-label v-else>女</el-label>
        </template>
      </el-table-column>
      <el-table-column prop="cust_deta" label="详细职位"> </el-table-column>
      <el-table-column prop="com_ka_name" label="KA"> </el-table-column>
      <el-table-column label="视频KA">
        <template slot-scope="scope">
          <el-label v-if="scope.row.com_mp4">待定</el-label>
          <el-label v-else>是</el-label>
        </template>
      </el-table-column>
      <el-table-column prop="cust_email" label="邮箱"> </el-table-column>
      <el-table-column prop="cust_update_name" label="更新人">
      </el-table-column>
      <el-table-column prop="cust_update_date" label="更新时间">
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="100">
        <template slot-scope="scope">
          <el-button
            @click="EditUpdate(scope.row.cust_id)"
           
            type="text"
            size="small"
            >编辑</el-button
          >
          <el-button
            @click="EditDelete(scope.row.cust_id)"
            type="text"
            size="small"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <!--添加弹出框开始
添加弹出框开始
添加弹出框开始
-->
    <el-dialog :visible.sync="IsAddShow" width="60%">
      <el-form :inline="true" :model="AddList" class="demo-form-inline">
        <el-form-item label="客户姓名">
          <el-input v-model="AddList.cust_name"></el-input>
        </el-form-item>

        <el-form-item label="英文名">
          <el-input v-model="AddList.cust_englishname"></el-input>
        </el-form-item>

        <el-form-item label="性别">
          <el-select v-model="AddList.cust_sex" placeholder="性别">
            <el-option label="男" :value="1"></el-option>
            <el-option label="女" :value="0"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="行业">
          <el-select v-model="AddList.com_ind_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in hangs"
              :key="item.com_ind_id"
              :label="item.com_ind_name"
              :value="item.com_ind_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="公司">
          <el-input v-model="AddList.com_name" @change="dosave()"></el-input>
        </el-form-item>

        <el-form-item label="Ka">
          <el-select v-model="AddList.com_ka_id" placeholder="请选择" disabled>
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in kas"
              :key="item.com_ka_id"
              :label="item.com_ka_name"
              :value="item.com_ka_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="视频KA">
          <el-select v-model="AddList.mp4ka" placeholder="视频KA" disabled>
            <el-option label="请选择" :value="0"></el-option>
            <el-option label="待定" :value="1"></el-option>
            <el-option label="你好" :value="2"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="公司性质">
          <el-select v-model="AddList.xing" placeholder="请选择" disabled>
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in xings"
              :key="item.nat_id"
              :label="item.nat_name"
              :value="item.nat_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="AD tech">
          <el-select v-model="AddList.adtech" placeholder="AD tech" disabled>
            <el-option label="请选择" :value="0"></el-option>
            <el-option label="否" :value="1"></el-option>
            <el-option label="待定" :value="2"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="公司地址">
          <el-input v-model="AddList.adds" disabled></el-input>
        </el-form-item>

        <el-form-item label="所属区域">
          <el-select v-model="AddList.area_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in qus"
              :key="item.area_id"
              :label="item.area_name"
              :value="item.area_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="部门">
          <el-input v-model="AddList.cust_depa"></el-input>
        </el-form-item>

        <el-form-item label="职位">
          <el-select v-model="AddList.posi_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in zhis"
              :key="item.posi_id"
              :label="item.posi_name"
              :value="item.posi_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="详细职位">
          <el-input v-model="AddList.cust_deta"></el-input>
        </el-form-item>

        <el-form-item label="分级">
          <el-select v-model="AddList.leve_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in fens"
              :key="item.leve_id"
              :label="item.leve_name"
              :value="item.leve_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="权力决策">
          <el-select v-model="AddList.auth_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in quans"
              :key="item.auth_id"
              :label="item.auth_name"
              :value="item.auth_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="语言偏好">
          <el-select v-model="AddList.lang_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in langs"
              :key="item.lang_id"
              :label="item.lang_name"
              :value="item.lang_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="工作电话">
          <el-input v-model="AddList.lang_workphone"></el-input>
        </el-form-item>

        <el-form-item label="电子邮箱">
          <el-input v-model="AddList.cust_email"></el-input>
        </el-form-item>

        <el-form-item label="手机">
          <el-input v-model="AddList.cust_phone"></el-input>
        </el-form-item>

        <el-form-item label="生日">
          <el-input type="date" v-model="AddList.cust_birt"></el-input>
        </el-form-item>

        <el-form-item label="邮政编码">
          <el-input v-model="AddList.cust_postal"></el-input>
        </el-form-item>

        <el-form-item label="腾讯销售">
          <el-input v-model="AddList.cust_market"></el-input>
        </el-form-item>

        <el-form-item label="兴趣爱好">
          <el-input v-model="AddList.cust_hobby"></el-input>
        </el-form-item>

        <el-form-item label="客户价值表述">
          <el-input v-model="AddList.cust_desc"></el-input>
        </el-form-item>
        <el-form-item label="微信号">
          <el-input v-model="AddList.cust_wecha"></el-input>
        </el-form-item>
        <el-form-item label="创建时间">
          <el-input type="date" v-model="AddList.cust_create"></el-input>
        </el-form-item>
        <el-form-item label="修改时间">
          <el-input type="date" v-model="AddList.cust_modi"></el-input>
        </el-form-item>
        <el-form-item label="备注">
          <el-input v-model="AddList.cust_remark"></el-input>
        </el-form-item>

        <!-- <el-form-item>
        <el-button type="primary" @click="ClientShowCha">查询</el-button>
      </el-form-item> -->
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="Addinsert">保存</el-button>
        <el-button @click="AdddingCole">关闭</el-button>
      </span>
    </el-dialog>

    <!--添加弹出框结束
添加弹出框结束
添加弹出框结束
-->

    <!--修改0-->
    <el-dialog :visible.sync="IsEditShow" width="60%">
      <el-form :inline="true" :model="EditTabel" class="demo-form-inline">
        <el-form-item label="客户姓名">
          <el-input v-model="EditTabel.cust_name"></el-input>
        </el-form-item>

        <el-form-item label="英文名">
          <el-input v-model="EditTabel.cust_englishname"></el-input>
        </el-form-item>

        <el-form-item label="性别">
          <el-select v-model="EditTabel.cust_sex" placeholder="性别">
            <el-option label="男" :value="1"></el-option>
            <el-option label="女" :value="0"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="行业">
          <el-select v-model="EditTabel.com_ind_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in hangs"
              :key="item.com_ind_id"
              :label="item.com_ind_name"
              :value="item.com_ind_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="公司">
          <el-input v-model="EditTabel.com_name"></el-input>
        </el-form-item>

        <el-form-item label="Ka">
          <el-select v-model="EditTabel.com_ka_id" placeholder="请选择" disabled>
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in kas"
              :key="item.com_ka_id"
              :label="item.com_ka_name"
              :value="item.com_ka_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="视频KA">
          <el-select v-model="EditTabel.mp4ka" placeholder="视频KA" disabled>
            <el-option label="请选择" :value="0"></el-option>
            <el-option label="待定" :value="1"></el-option>
            <el-option label="你好" :value="2"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="公司性质">
          <el-select v-model="EditTabel.xing" placeholder="请选择" disabled>
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in xings"
              :key="item.nat_id"
              :label="item.nat_name"
              :value="item.nat_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="AD tech">
          <el-select v-model="EditTabel.adtech" placeholder="AD tech" disabled>
            <el-option label="请选择" :value="0"></el-option>
            <el-option label="否" :value="1"></el-option>
            <el-option label="待定" :value="2"></el-option>
          </el-select>
        </el-form-item>

       
       
       
        
        <el-form-item label="公司地址">
          <el-input v-model="EditTabel.adds" disabled></el-input>
        </el-form-item>

        <el-form-item label="所属区域">
          <el-select v-model="EditTabel.area_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in qus"
              :key="item.area_id"
              :label="item.area_name"
              :value="item.area_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="部门">
          <el-input v-model="EditTabel.cust_depa"></el-input>
        </el-form-item>

        <el-form-item label="职位">
          <el-select v-model="EditTabel.posi_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in zhis"
              :key="item.posi_id"
              :label="item.posi_name"
              :value="item.posi_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="详细职位">
          <el-input v-model="EditTabel.cust_deta"></el-input>
        </el-form-item>

        <el-form-item label="分级">
          <el-select v-model="EditTabel.leve_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in fens"
              :key="item.leve_id"
              :label="item.leve_name"
              :value="item.leve_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="权力决策">
          <el-select v-model="EditTabel.auth_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in quans"
              :key="item.auth_id"
              :label="item.auth_name"
              :value="item.auth_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="语言偏好">
          <el-select v-model="EditTabel.lang_id" placeholder="请选择">
            <el-option label="请选择" value="0"></el-option>
            <el-option
              v-for="item in langs"
              :key="item.lang_id"
              :label="item.lang_name"
              :value="item.lang_id"
            >
            </el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="工作电话">
          <el-input v-model="EditTabel.lang_workphone"></el-input>
        </el-form-item>

        <el-form-item label="电子邮箱">
          <el-input v-model="EditTabel.cust_email"></el-input>
        </el-form-item>

        <el-form-item label="手机">
          <el-input v-model="EditTabel.cust_phone"></el-input>
        </el-form-item>

        <el-form-item label="生日">
          <el-date-picker type="date" placeholder="选择日期" v-model="EditTabel.cust_birt" style="width: 100%;"></el-date-picker>
          
        </el-form-item>

        <el-form-item label="邮政编码">
          <el-input v-model="EditTabel.cust_postal"></el-input>
        </el-form-item>

        <el-form-item label="腾讯销售">
          <el-input v-model="EditTabel.cust_market"></el-input>
        </el-form-item>

        <el-form-item label="兴趣爱好">
          <el-input v-model="EditTabel.cust_hobby"></el-input>
        </el-form-item>

        <el-form-item label="客户价值表述">
          <el-input v-model="EditTabel.cust_desc"></el-input>
        </el-form-item>
        <el-form-item label="微信号">
          <el-input v-model="EditTabel.cust_wecha"></el-input>
        </el-form-item>
        <el-form-item label="创建时间">
           <el-date-picker type="date" placeholder="选择日期" v-model="EditTabel.cust_create" style="width: 100%;"></el-date-picker>
         
        </el-form-item>
        <el-form-item label="修改时间">
           <el-date-picker type="date" placeholder="选择日期" v-model="EditTabel.cust_modi" style="width: 100%;"></el-date-picker>
         
        </el-form-item>
        <el-form-item label="备注">
          <el-input v-model="EditTabel.cust_remark"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="ClientUpdata">确认修改</el-button>
        <el-button @click="AdddingCole">关闭</el-button>
      </span>
    </el-dialog>
    <!--
  分页开始
-->
    <div class="block">
      <el-pagination
        @size-change="ClientShow"
        @current-change="ClientShow"
        :current-page.sync="Show.pageIndex"
        :page-sizes="[3, 5, 8, 20]"
        :page-size.sync="Show.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="Show.total"
      >
      </el-pagination>
    </div>
    <!--分页结束-->
  </div>
</template>
<script>
export default {
  data() {
    return {
      Dict:[],//字典
      dt_type_key:"",
      Show: {
        formInline: {
          hang: "0",
          ka: "0",
          qu: "0",
          fen: "0",
          gong: "",
          xname: "",
          shi: "0",
          ad: "0",
        },
        tableData: [],
        pageIndex: 1,
        pageSize: 3,
        total: 0,
      },
      hangs: [],
      kas: [],
      qus: [],
      fens: [],
      IsAddShow: false,

      AddList: {
        com_id: null,
        cust_name: "", //
        cust_englishname: "", //
        cust_sex: null, //
        com_ind_id: null, //
        com_name: "", //
        com_ka_id: null, //
        mp4ka: "",
        xing: null,
        adtech: "",
        adds: "",
        area_id: null, //
        cust_depa: "", //
        posi_id: null, //
        cust_deta: "", //
        leve_id: null, //
        auth_id: null, //
        lang_id: null, //
        lang_workphone: "", //
        cust_email: "", //
        cust_phone: "", //
        cust_birt: "", //
        cust_postal: "", //
        cust_market: "", //
        cust_hobby: "", //
        cust_desc: "", //
        cust_wecha: "", //
        cust_create: "", //
        cust_modi: "", //
        cust_remark: "", //
      },
      xings: [],
      zhis: [],
      quans: [],
      langs: [],
      GongFan: [],
       GongFana: [],
      IsEditShow: false,
      zhuan:null,
      //cust_id: null,
      EditTabel:{
        com_id: null,
        cust_name: "", //
        cust_englishname: "", //
        cust_sex: null, //
        com_ind_id: null, //
        com_name: "", //
        com_ka_id: null, //
        mp4ka: "",
        xing: null,
        adtech: "",
        adds: "",
        area_id: null, //
        cust_depa: "", //
        posi_id: null, //
        cust_deta: "", //
        leve_id: null, //
        auth_id: null, //
        lang_id: null, //
        lang_workphone: "", //
        cust_email: "", //
        cust_phone: "", //
        cust_birt: "", //
        cust_postal: "", //
        cust_market: "", //
        cust_hobby: "", //
        cust_desc: "", //
        cust_wecha: "", //
        cust_create: "", //
        cust_modi: "", //
        cust_remark: "", //
      },
    };
  },
  // props:{
  //     //接调用组件的值
  //   typeKey: String, //字典类别Key
  //   fieldValue: {}, //绑定属性
  // },
  // computed:{
  //   //字典绑定字段  组件内部使用
  //   fieldValueC:{
  //     get(){
  //       return this.fieldValue;
  //     },
  //     set(val){
  //       this.fieldValue=val;
  //       //$emit用于把修改props操作传递给外部组件  把对于province  props的修改同步到父组件
  //       this.$emit("update:fieldValue",val);
  //     },
  //   },
  // },
  created() {
    this.ClientShow();
    this.Hangye();
    this.Kaa();
    this.Quyu();
    this.Fenji();
    this.Xing();
    this.Zhi();
    this.Quan();
    this.Lang();
    //this.init();
  },
  methods: {
    // //字典
    // init(){
    //   var that=this;
    //   //GetDtListByTypeKey(this.typeKey).then()
    //   this.$axios.get("http://localhost:38204/api/ClientAdmin/DictiShow?dt_type_key="+this.dt_type_key).then(
    //     (r)=>{
    //       console.log(r)
          
    //         that.Dict=r.data.data;
          
    //     }
    //   )
    // },
    //修改方法
    ClientUpdata(){
      this.$axios.post("http://localhost:38204/api/ClientAdmin/EditXiu",this.EditTabel).then(
        (r)=>{
          console.log(r)
          if(r.data.code==1)
          {
            this.$message("修改成功");
            this.IsEditShow=false;
            this.ClientShow();
          }
          else
          {
            this.$message("修改失败");
          }
        }
      )
    },
    //客户管理
    EditUpdate(cust_id) {
      var that = this;
     // that.cust_id = cust_id;//修改id获取
      that.IsEditShow = true;//弹窗
      this.$axios.get("http://localhost:38204/api/ClientAdmin/EditeList?cust_id="+cust_id).then(
        (r)=>{
          if(r.data!=null)
          {
            that.EditTabel=r.data.data;
            that.EditTabel.cust_id=cust_id;
            this.dosaveaa();
          }
        }
      )
      
    },
    
    Addinsert() {
      var that = this;
      this.$axios
        .post("http://localhost:38204/api/ClientAdmin/ClientAdd", this.AddList)
        .then((r) => {
          if (r.data.data == 1) {
            this.$message("添加成功");
            this.ClientShow();
          } else {
            this.$message("添加失败");
          }
        });
    },
    //添加时根据公司名称反填个别字段
    dosave() {
      var that = this;
      var comname = this.AddList.com_name;
      this.$axios
        .get(
          "http://localhost:38204/api/ClientAdmin/CompList?comname=" + comname
        )
        .then((r) => {
          if (r.data != null) {
            that.GongFan = [], 
            that.GongFan = r.data.data;
            that.AddList.adds = that.GongFan[0].com_site;
            that.AddList.com_ka_id = that.GongFan[0].com_ka_id;
            that.AddList.mp4ka = that.GongFan[0].com_mp4;
            //console.log(that.AddList.mp4ka);
            that.AddList.xing = that.GongFan[0].nat_id;
            that.AddList.adtech = that.GongFan[0].com_ad;
            that.AddList.com_id = that.GongFan[0].com_id;
          }
        });
    },

    //修改时根据公司名称反填个别字段
    dosaveaa() {
      var that = this;
      var comname = this.EditTabel.com_name;
      this.$axios
        .get(
          "http://localhost:38204/api/ClientAdmin/CompList?comname=" + comname
        )
        .then((r) => {
          if (r.data != null) {
            that.GongFana = [], 
            that.GongFana = r.data.data;
            that.EditTabel.adds = that.GongFana[0].com_site;
            that.EditTabel.com_ka_id = that.GongFana[0].com_ka_id;
            that.EditTabel.mp4ka = that.GongFana[0].com_mp4;
            that.EditTabel.xing = that.GongFana[0].nat_id;
            that.EditTabel.adtech = that.GongFana[0].com_ad;
            that.EditTabel.com_id = that.GongFana[0].com_id;
            
            this.IsEditShow=false;
            this.IsEditShow=true;
            
          }
        });
    },

    Quan() {
      this.$axios
        .get("http://localhost:38204/api/ClientAdmin/Acthdown")
        .then((r) => {
          if (r.data != null) {
            this.quans = r.data.data;
          }
        });
    },
    Lang() {
      this.$axios
        .get("http://localhost:38204/api/ClientAdmin/Langdown")
        .then((r) => {
          if (r.data != null) {
            this.langs = r.data.data;
          }
        });
    },
    Zhi() {
      this.$axios
        .get("http://localhost:38204/api/ClientAdmin/Posidown")
        .then((r) => {
          if (r.data != null) {
            this.zhis = r.data.data;
          }
        });
    },
    Xing() {
      this.$axios
        .get("http://localhost:38204/api/ClientAdmin/Natdown")
        .then((r) => {
          if (r.data != null) {
            this.xings = r.data.data;
          }
        });
    },
    //客户管理显示
    ClientShow() {
      var that = this;
      this.$axios
        .get("http://localhost:38204/api/ClientAdmin/ClientAdminShow", {
          params: {
            hang: that.Show.formInline.hang,
            ka: that.Show.formInline.ka,
            qu: that.Show.formInline.qu,
            fen: that.Show.formInline.fen,
            shi: that.Show.formInline.shi,
            ad: that.Show.formInline.ad,
            gong: that.Show.formInline.gong,
            xname: that.Show.formInline.xname,
            pageIndex: that.Show.pageIndex,
            pageSize: that.Show.pageSize,
          },
        })
        .then((r) => {
          if (r.data != null) {
            that.Show.tableData = r.data.data.data;
            that.Show.total = r.data.data.total;
          }
        });
    },
    //行业下拉
    Hangye() {
      var that = this;
      this.$axios
        .get("http://localhost:38204/api/ClientAdmin/Inddown")
        .then((r) => {
          if (r.data != null) {
            that.hangs = r.data.data;
          }
        });
    },
    //Ka下拉
    Kaa() {
      var that = this;
      this.$axios
        .get("http://localhost:38204/api/ClientAdmin/Kadown")
        .then((r) => {
          if (r.data != null) {
            that.kas = r.data.data;
          }
        });
    },
    //区域下拉
    Quyu() {
      var that = this;
      this.$axios
        .get("http://localhost:38204/api/ClientAdmin/Areadown")
        .then((r) => {
          if (r.data != null) {
            that.qus = r.data.data;
          }
        });
    },
    //分级下拉
    Fenji() {
      var that = this;
      this.$axios
        .get("http://localhost:38204/api/ClientAdmin/Leveldown")
        .then((r) => {
          if (r.data != null) {
            that.fens = r.data.data;
          }
        });
    },
    //查询
    ClientShowCha() {
      this.ClientShow();
    },

    //客户删除
    EditDelete(cust_id) {
      if (confirm("确认要删除吗")) {
        var that = this;
        this.$axios
          .post(
            "http://localhost:38204/api/ClientAdmin/Cust_Delete?cust_id=" +
              cust_id
          )
          .then((r) => {
            if (r.data.data == 1 && r.data.code == 1) {
              this.$message("删除成功");
              this.ClientShow();
            } else {
              this.$message("删除失败");
            }
          });
      }
    },
    //客户添加
    ClientAdd() {
      //this.$router.push("/ClientManagerAdd");
      this.IsAddShow = true;
    },
    //添加弹出关闭
    AdddingCole() {
      this.IsAddShow = false;
    },
  },
};
</script>